Skip to content

feat(pkg): add --rpm-file flag to package list command#136

Open
liunan-ms wants to merge 1 commit intomicrosoft:mainfrom
liunan-ms:liunan/support_rpm_file
Open

feat(pkg): add --rpm-file flag to package list command#136
liunan-ms wants to merge 1 commit intomicrosoft:mainfrom
liunan-ms:liunan/support_rpm_file

Conversation

@liunan-ms
Copy link
Copy Markdown
Contributor

@liunan-ms liunan-ms commented Apr 30, 2026

This PR adds --rpm-file <file> flag to azldev package list that accepts a JSON RPM source map file (array of {packageName, sourcePackageName} records) and lists all SRPMs and their binary RPMs with their resolved publish channels.

  • Add RPMFile string field to ListPackageOptions
  • Add listPackagesFromRPMFile helper to handle the --rpm-file path with early return
  • Add resolveFromSRPMFile to resolve each SRPM (via SRPMChannel) and each binary RPM (via full publish-channel stack) from the JSON file
  • Results include a 'type' column ('srpm' or 'rpm') to distinguish entry kinds
  • '--rpm-file' is mutually exclusive with '-a', '-p', and '--synthesize-debug-packages'
  • Update docs/user/how-to/inspect-package-config.md: add Type column to output table, document --rpm-file usage and mutual exclusivity, add JSON example
  • Update auto-generated CLI reference docs (azldev_package_list.md)

JSON RPM source map file format:

[
  { "packageName": "cmake-gui", "sourcePackageName": "cmake" },
  ...
]

Output:

[
  {
      "packageName": "cmake",
      "type": "srpm",
      "group": "",
      "component": "cmake",
      "publishChannel": "rpm-base-srpm"
    },
    {
      "packageName": "cmake",
      "type": "rpm",
      "group": "",
      "component": "cmake",
      "publishChannel": "rpm-base"
    },
    {
      "packageName": "cmake-data",
      "type": "rpm",
      "group": "",
      "component": "cmake",
      "publishChannel": "rpm-base"
    },
    {
      "packageName": "cmake-doc",
      "type": "rpm",
      "group": "",
      "component": "cmake",
      "publishChannel": "rpm-base"
    },
    {
      "packageName": "cmake-filesystem",
      "type": "rpm",
      "group": "",
      "component": "cmake",
      "publishChannel": "rpm-base"
    },
    {
      "packageName": "cmake-gui",
      "type": "rpm",
      "group": "sdk-published",
      "component": "cmake",
      "publishChannel": "rpms-sdk"
    },
    {
      "packageName": "cmake-rpm-macros",
      "type": "rpm",
      "group": "",
      "component": "cmake",
      "publishChannel": "rpm-base"
    }
...
]

Copilot AI review requested due to automatic review settings April 30, 2026 17:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new input mode to azldev package list to enumerate SRPMs and their binary RPMs from a JSON “RPM source map” file, and surfaces the result kind via a new type column.

Changes:

  • Add --rpm-file <file> and ListPackageOptions.RPMFile, plus JSON parsing/resolution helpers to emit both SRPM and RPM rows.
  • Extend output model with a type field (srpm/rpm) and wire it through existing listing/synthesis paths.
  • Update user guide and regenerate CLI reference docs; add a test covering SRPM vs RPM channel selection.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
internal/app/azldev/cmds/pkg/list.go Implements --rpm-file, JSON parsing, SRPM/RPM resolution, and adds type to results/help text.
internal/app/azldev/cmds/pkg/list_test.go Updates existing list tests and adds coverage for SRPM-file resolution behavior.
docs/user/reference/cli/azldev_package_list.md Regenerated CLI docs reflecting new --rpm-file option and updated help text.
docs/user/how-to/inspect-package-config.md Documents the new type column and --rpm-file workflow and constraints.

Comment thread internal/app/azldev/cmds/pkg/list.go Outdated
Comment thread internal/app/azldev/cmds/pkg/list.go Outdated
Comment thread internal/app/azldev/cmds/pkg/list.go
Comment thread internal/app/azldev/cmds/pkg/list.go Outdated
Comment thread internal/app/azldev/cmds/pkg/list.go Outdated
Comment thread internal/app/azldev/cmds/pkg/list.go Outdated
@liunan-ms liunan-ms force-pushed the liunan/support_rpm_file branch from 1f23e96 to 8e357a4 Compare April 30, 2026 18:56
Add '--rpm-file <file>' flag to 'azldev package list' that accepts a JSON
RPM source map file (array of {packageName, sourcePackageName} records) and
lists all SRPMs and their binary RPMs with their resolved publish channels.

- Add RPMFile string field to ListPackageOptions
- Add listPackagesFromRPMFile helper to handle the --rpm-file path with early return
- Add resolveFromSRPMFile to resolve each SRPM (via SRPMChannel) and each binary
  RPM (via full publish-channel stack) from the JSON file
- Results include a 'type' column ('srpm' or 'rpm') to distinguish entry kinds
- '--rpm-file' is mutually exclusive with '-a', '-p', and '--synthesize-debug-packages'
- Update docs/user/how-to/inspect-package-config.md: add Type column to output
  table, document --rpm-file usage and mutual exclusivity, add JSON example
- Update auto-generated CLI reference docs (azldev_package_list.md)
@liunan-ms liunan-ms force-pushed the liunan/support_rpm_file branch from 8e357a4 to c3b17b0 Compare April 30, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants